import request from '@/utils/request'

import { baseUrlConfig } from '@/config/config'
const basePath = baseUrlConfig.processBaseUrl

export interface PageListType {
  pageNum?: number
  pageSize?: number
  condition: {
    projectType: string
    projectNo: string
    projectName:string
    applyNo:string
    startTime:string
    endTime:string
    location:string
  }
}

// 获取数量
export const getTotal = (data: any) => {
  return request({
      url: basePath + '/cm/dossier/conditions/num',
      method: 'post',
      data
  })
}

// 删除
export const delData = (id: number) => {
  return request({
      url: basePath + '/cm/dossier/delete',
      method: 'post',
      data: {id}
  })
}

// 获取分页列表
export const getPageList: (data: any) => Promise<[]> = (data) => {
  return request({
    url: basePath + '/cm/dossier/find/page',
    method: 'post',
    data
  })
}

// 档案下载
export const exportFile: (data: any) => Promise<[]> = (data) => {
  return request({
    responseType: 'blob',
    url: basePath + '/cm/dossier/down',
    method: 'post',
    data
  })
}
